import request from '@/router/axios';
//发送邮件
export const sendEmail = (row) => {
  return request({
    url: '/api/blade-email/emailInfo',
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: JSON.stringify(row)
  })
}

//上传附件
export const uploadText = (data) => {
  return request({
    url: '/api/blade-file/file/upload',
    method: 'post',
    headers: {
      "Content-Type": "multipart/form-data"
    },
    data
  })
}
//获取往来邮件
export const relationEmail = (data) => {
  return request({
    url: '/api/blade-email/emailInfo/customer/all/list',
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data
  })
}
//获取往来邮件的客户名称
export const relationCustomer = (emailList) => {
  return request({
    url: '/api/blade-custom/tCustLinker/exist/list',
    method: 'get',
    params:emailList
  })
}
//获取往来邮件  - 客户模块专用 - /customer/all/list
export const relation = (data) => {
  return request({
    url: '/api/blade-email/emailInfo/customer/all/count',
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data
  })
}
//设置已读
export const getRead = (data) => {
  return request({
    url: '/api/blade-email/emailInfo/read',
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data
  })
}
//模糊查询
export const getCustomerSuggest = (query) => {
  return request({
    url: `/api/blade-email/emailInfo/match?keyWord=${query}`,
    method: 'get',
  })
}
